x is a Date value or a DateTime value.
Year extracts the year from a date and returns it as a Number.
Use this function any time you need to use a year, converted to a Number, in calculations or comparisons.
The following examples are applicable to Crystal syntax:
Returns 1989, where the last invoice date was in 1989.
If Year({file.LAST UPGRADE}) < 1988 Then
"P.S. You are missing out on many of the benefits of our new, improved version."
Prints a P.S. for those customers who last upgraded prior to 1988, and prints nothing for those customers who show a more recent upgrade.
Year(CDateTime(1996, 3, 3, 10, 33, 20))
This function is designed to work like the Visual Basic function of the same name.
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |